<!DOCTYPE html>
<html lang="en">
<head>
<title>How do I create a calculated question?</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="" name="description">
<link href="../css/help.css" media="all" rel="stylesheet" type="text/css" charset="utf-8">
<link href="/library/webjars/fontawesome/4.7.0/css/font-awesome.min.css" media="screen" rel="stylesheet">
<link href="/library/skin/morpheus-default/tool.css" media="screen" rel="stylesheet" type="text/css" charset="utf-8">
<script src="/library/webjars/jquery/1.12.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/library/js/headscripts.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
    includeWebjarLibrary('featherlight');
    $(document).ready(function(){
      $("a.screensteps-image-zoom").featherlight({
        type: { image:true },
        closeOnClick: 'anywhere'
      }); 
    });   
</script>
</head>
<body>
  <div><div>
<div><h1 class="article-title">How do I create a calculated question?</h1></div>
<div>



    <div class="step-instructions screensteps-textblock screensteps-wrapper--introduction screensteps-wrapper">
  <div id="text-content_90087D35-BC7F-4CB3-9D44-3876025CB9FF" class="text-block-content">
    <p>This allows for a calculated question to be added to a new or existing assessment. A calculated question calculates new answers for every test, based on variables whose value changes each time. The answer is based on a formula, using those variables.</p>
  </div>
</div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Go to Tests &amp; Quizzes.</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/771/original/e1456eb7-5ef6-48cf-9741-440ea7c00341.png" alt="" height="119" width="205">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_da8872c9-04ad-4937-b256-b846ff2f21e5" class="text-block-content">
    <p>Select the <strong>Tests &amp; Quizzes</strong> tool from the Tool Menu of your course.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Select an assessment.</h2>
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_3bd0d408-66dc-4a8c-ace0-a73448a9c9ba" class="text-block-content">
    <p>Questions may be added to any assessment. Select an existing assessment or create a new one. </p>
<p><em>Note: You may also </em><a href="content.hlp?docId=howdoiaddaquestiontoaquestionpool"><em>add a question directly to a question pool</em></a><em>. </em></p>
  </div>
</div>
 
        <div class="step screensteps-section screensteps-depth-2">
    <h3 class="step-title screensteps-heading">Create a New Assessment.</h3>
        <div class="step screensteps-section screensteps-depth-3">
    <h4 class="step-title screensteps-heading">Click Add.</h4>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/773/original/74dde9dd-c6ae-45bb-a840-71081f4fd0bc.png" alt="" height="60" width="662">
  </div>
 
        <div class="step screensteps-section screensteps-depth-4">
    <h5 class="step-title screensteps-heading">Create a new assessment.</h5>
  </div>
 
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/775/original/1f405d29-0699-4d5d-99f7-326bc19dc3b7.png" alt="" height="421" width="590">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_cace0015-f8f0-4b58-b943-975d664cb57f" class="text-block-content">
    <p>For more information on creating new assessments, see <a href="content.hlp?docId=howdoicreateanassessmentintestsandquizzes">How do I create an assessment?</a> </p>
<ol>
<li>Enter an <strong>Assessment Title</strong>.</li>
<li>Select the <strong>Create using assessment builder</strong> radio button.</li>
<li>Click <strong>Create</strong>.</li>
</ol>
  </div>
</div>
 
  </div>
 
  </div>
 
        <div class="step screensteps-section screensteps-depth-2">
    <h3 class="step-title screensteps-heading">Or edit an existing assessment.</h3>
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/009/373/777/original/1dcbf920-ff55-44fe-86e4-d229039f3c05.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/009/373/777/medium/1dcbf920-ff55-44fe-86e4-d229039f3c05.png" alt="" height="358" width="855">
      </a>
  </div>
 
  </div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1" id="select-calculated-question-from-drop-down-menu">
    <h2 class="step-title screensteps-heading">Select Calculated Question from drop-down menu.</h2>
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/003/302/385/original/fc566b4f-6502-4533-b0f1-978de836aaa8.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/003/302/385/medium/fc566b4f-6502-4533-b0f1-978de836aaa8.png" alt="" height="550" width="855">
      </a>
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_CD74CB22-925E-405D-870D-A780C55A72A2" class="text-block-content">
    <p>After selecting Calculated Question from the drop-down menu, the program will open options for the question.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Set the point value for the question.</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/779/original/b3b31374-1e45-4561-88f3-7ae1dff41d82.png" alt="" height="48" width="307">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_9bfde69c-91d6-4d53-b62f-1cfbae04c4b0" class="text-block-content">
    <p>Enter the point value for this question. Questions may be worth any point value you choose.  </p>
<p><em>Tip: Keep in mind that the point value of all the questions in the assessment will equal the point value of the assessment in the Gradebook. So if you want your assessment to be worth a total of 100 points, you should assign point values to your questions accordingly.</em></p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Display points?</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/780/original/eb1d5027-c341-41e8-b96d-01d36c2e5503.png" alt="" height="81" width="297">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_7823c99a-9e26-42ae-9a85-3099d876ac32" class="text-block-content">
    <p>If you want students to see the point value as they are taking the test, leave the default setting of <strong>Yes</strong>. If you prefer that students do not see the point value for the question, select <strong>No</strong>.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Extra Credit. (Optional)</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/782/original/56c3330e-747d-4b7a-9223-88cc71894d3d.png" alt="" height="36" width="200">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_f29b0cd5-2031-4f1b-90c4-8e89779df265" class="text-block-content">
    <p>Selecting this option lets you mark a question as extra credit. This means that the points awarded for this question are not counted as part of the "total points" for the assessment and there are no points deducted for skipping this question or answering incorrectly. However, users answering correctly will receive the question point value added on top of their total points earned in the assessment.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1" id="description-and-instructions">
    <h2 class="step-title screensteps-heading">Description and Instructions</h2>
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_e165f800-62f1-43ad-9944-fc0d05729faa" class="text-block-content">
    <p>A description of the Calculated question type, including examples and instructions for creating a Calculated question follow. </p>
<p><strong>What is a Calculated Question</strong></p>
<p>A calculated question calculates new answers for every test, based on variables whose value changes each time. The answer is based on a formula, using those variables. That is, the variables will be randomly generated from your specified minimum and max range and the formula will be the input the student would be asked for.</p>
<p>A variable definition has a name, a minimum and maximum value, and a number of decimal places. A formula definition has a name, an mathematical expression that uses the variables, and a tolerance, so that answers within that tolerance of the answer are also considered correct.</p>
<p><strong>Example 1</strong></p>
<p>Kevin has {x} apples. He buys {y} more. Now Kevin has [[{x}+{y}]]. Jane eats {z} apples. Kevin now has {{w}} apples.</p>
<p><em>The formula w in the example above would be defined as: {x} + {y} - {z}.</em></p>
<p>The above question will then be displayed as the following question for the student: Kevin has 4 apples. He buys 2 more. Now Kevin has 6 apples. Jane eats 2 apples. Kevin now has ___ apples.</p>
<p><strong>Example 2</strong></p>
<p>Solve: cos({a}) * ({c} - {b}) = {{z}}.</p>
<p><em>The formula z in the example above would be defined as: cos({a}) * ({c} - {b}).</em></p>
<p><strong>Instructions</strong></p>
<p>Steps to create a Calculated Question</p>
<ol>
<li>Fill out the Question Text with the information that the student will see, including the variable and formula placeholders (see examples below).</li>
<li>Press the "Extract Variables, Global Variables, Calculations, and Formulas from Question Text" button to create the variables and formulas.</li>
<li>Change the Min, Max, and Decimal Places for all of the variables to define their ranges of valid values.</li>
<li>Enter the mathematical expression for each Formula, inserting the Variables where needed.</li>
<li>Press the Save button to save your work.</li>
<li>Any errors will be displayed at the top of the page. They must be fixed before saving. Fields with errors will be highlighted to show you where you have problems.</li>
</ol>
<p><strong>Syntax Guidelines</strong></p>
<p>Create variables</p>
<ul>
<li>{}</li>
<li>Use curly braces {} around a letter to create variables.</li>
<li>Kevin has {x} apples.</li>
</ul>
<p>Calculations</p>
<ul>
<li>[[]]</li>
<li>Internal calculations using the variables can be added using double square brackets [[]].</li>
<li>The area of a square is [[ {s} * {s} ]]m. Find the side length {{Z}}. <em>Formula Z would be {s}.</em>
</li>
</ul>
<p>Create formulas for student input</p>
<ul>
<li>{{}}</li>
<li>Use double curly braces {{}} around a letter to create a formula.</li>
<li>Kevin has {x} apples. He buys {y} more. Now Kevin has [[{x}+{y}]]. Jane eats {z} apples. Kevin now has {{w}} apples. <em>The formula w in the example above would be defined as: {x} + {y} - {z}.</em>
</li>
</ul>
<p>Create Global Variables</p>
<ul>
<li>@@</li>
<li>Global variables are intermediate formulas that can be used within the instructions, other global variables, answer formula, or feedback. Use @@ around the variable names to create a global variable. To display the value of the global variable in the question, rather than the formula, use the double square brackets for internal calculations around the global variable placeholder.</li>
<li>@x1@ or [[@x1@]]</li>
</ul>
<p><strong>Definitions</strong></p>
<p>Variables: These are random numbers generated from the minimum and maximum range specified in the 'variables' section. Variables are uniquely generated for each student and quiz attempt based on this range.</p>
<p>Formulas: Formulas are pre-defined relationships between the variables.</p>
<p>Creating global variables: In a global variable you can store a formula and in other sections (instructions, global variables, solution, feedback) you can use this global variable to refer to the calculation.</p>
<p><strong>Additional Information</strong></p>
<ol>
<li>You may define acceptable tolerance as a constant (0.01) or percentage (1.5%) of the answer. (Defaults to 0.01).</li>
<li>Variables and formulas support decimals. Default is 3.</li>
<li>
<strong>Warning!</strong> When setting the number of decimals to be applied in the FORMULA, you must use the same (or less) number of decimals in the TOLERANCE field, otherwise you may get unexpected results in the correction of the question.</li>
<li>Valid operators: + - * / ^ ! # ()</li>
<li>You can use many math functions including: sin, cos, tan, asin, acos, atan, abs, exp, sgn, sqrt, log10, and ln.</li>
<li>Characters └ and ┐ are reserved characters and cannot be used in the question text.</li>
<li>You can use scientific notation in variables, global variables, formulas and calculations (e.g 6.02310e23 or 1.67e-27).</li>
<li>There are built-in constants like pi(3.14...), e(2.718...), or [phi](1.618..). Use them in your formula expression.</li>
<li>Variables, Global Variables and formulas names are alpha-numeric but must begin with an alpha character.</li>
<li>Variables, Global Variables and formulas cannot have the same name.</li>
</ol>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Add Question Text.</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/783/original/b91627c0-913e-4d4d-b24d-335f3565afca.png" alt="" height="220" width="433">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_76DBA18E-D95A-4923-A1EC-2EA1E6066F46" class="text-block-content">
    <p>Type the <strong>Question Text</strong> into the text box provided. This is the information that the student will see, including the variable and formula placeholders (see examples below).</p>
<p><strong>Variables</strong>: Define variables to use in this question below. Reference them in the question text by putting them in single curly braces (e.g., {x}). Variable names are alpha-numeric but must begin with an alpha character. </p>
<p>Example: Kevin has {x} apples. Jane eats {y}. How many does Kevin have now? {{z}}</p>
<p><strong>Formulas</strong>: Place double curly braces (e.g., {{y}}) around a formula name to define where the student's input box will display. Formula names are alpha-numeric but must begin with an alpha character. </p>
<p><strong>Example:</strong> Solve: cos({a}) * ({c} - {b}) = {{z}}.</p>
<p><em>The formula z in the example above would be defined as: cos({a}) * ({c} - {b}).</em></p>
<p>Keep in mind the following:</p>
<ul>
<li>You may define acceptable tolerance as a constant (0.01) or percentage (1.5%) of the answer. (Defaults to 0.01.)</li>
<li>Variables and formulas support decimals. Default is 3.</li>
<li>Valid Operators: + - * / ^ ! # ( ) </li>
<li>You can use many math functions including: sin, cos, tan, asin, acos, atan, abs, exp, sgn, sqrt, log10, and ln.</li>
<li>There are two built-in constants, PI(3.14...) and e(2.718...). Use them in your answer expression.</li>
<li>Variables and Formulas cannot have the same name.</li>
<li>See <a href="http://mathparser.org/mxparser-math-collection/" target="">http://mathparser.org/mxparser-math-collection/</a> for the full set of valid math functions and operators. </li>
</ul>
<p><em>Note: To edit with </em><a href="content.hlp?docId=whatistherichtexteditor"><em>Rich Text Editor</em></a><em>, click the hyperlink to open the full menu.</em></p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Add attachment. (Optional)</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/785/original/24b834c6-1654-4be8-a44c-6dd8ff0fad1c.png" alt="" height="90" width="257">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_905fa824-3be0-488e-9af6-e84e466f09b8" class="text-block-content">
    <p>Click <strong>Add Attachments</strong> to browse for and select a file attachment if desired.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1" id="click-extract-variables-calculations-and-formulas">
    <h2 class="step-title screensteps-heading">Click Extract Variables, Calculations, and Formulas.</h2>
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/009/373/787/original/6326b8e0-5a6f-491e-a7f1-4ad272b33c4e.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/009/373/787/medium/6326b8e0-5a6f-491e-a7f1-4ad272b33c4e.png" alt="" height="380" width="855">
      </a>
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_3D1ACFBB-5069-454C-AF0C-5CD873276C28" class="text-block-content">
    <p>Click the <strong>Extract Variables, Calculations, and Formulas from Question Text</strong> button to create the variables and formulas.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1" id="define-ranges-of-variable-values">
    <h2 class="step-title screensteps-heading">Define ranges of variable values.</h2>
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/009/373/789/original/357bf2b6-a1fa-4475-97da-79ea7616975d.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/009/373/789/medium/357bf2b6-a1fa-4475-97da-79ea7616975d.png" alt="" height="242" width="855">
      </a>
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_7436E767-268F-4604-B091-43B746AD3839" class="text-block-content">
    <p>Change the Min, Max, and Decimal Places for all of the variables to define their ranges of valid values.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1" id="enter-the-formula">
    <h2 class="step-title screensteps-heading">Enter the formula.</h2>
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/009/373/791/original/0919b482-80f6-4a50-ba46-be0af64e7a9f.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/009/373/791/medium/0919b482-80f6-4a50-ba46-be0af64e7a9f.png" alt="" height="214" width="855">
      </a>
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_CBE619AA-1C64-468D-B100-D36E59CC8942" class="text-block-content">
    <p>Enter the mathematical expression for each Formula, inserting the Variables where needed.</p>
<p>Click the <strong>Check Formulas</strong> button once you have entered the formula.</p>
  </div>
</div>
 
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/009/373/794/original/e2ec9340-11b2-437b-aef3-c5359eb3228b.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/009/373/794/medium/e2ec9340-11b2-437b-aef3-c5359eb3228b.png" alt="" height="271" width="855">
      </a>
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_445a7be7-dc33-4699-8e2c-2e72ff64e60f" class="text-block-content">
    <p>If the formula is valid, you will see an <strong>OK</strong> status message.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Is it timed? (Optional)</h2>
        <div class="image screensteps-image">
      <a href="https://media.screensteps.com/image_assets/assets/009/373/796/original/d56e1432-c132-45e9-a80e-d173a71b69a1.png" class="screensteps-image-zoom">
        <img src="https://media.screensteps.com/image_assets/assets/009/373/796/medium/d56e1432-c132-45e9-a80e-d173a71b69a1.png" alt="" height="123" width="855">
      </a>
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_e8b9620e-9216-4f9e-9c58-e7e4b4529547" class="text-block-content">
    <p>This setting allows you to specify a time limit for an individual question. If timed, students have until the end of the time limit, or until the Final Submission Deadline, whichever comes first, to submit their work. Their answers will be automatically saved and submitted at the expiration of the timer. </p>
<p>Setting a time limit for an individual question can be useful if you would like to time students' responses per question, rather than setting a time limit for the entire assessment which may contain several different questions. </p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Assign to part. (Optional)</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/002/142/839/original/5b1c5ee8-b552-4922-be72-fda67a8d5f51.png" alt="" height="52" width="511">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_1633D510-24A7-469F-BDD9-C4790F52FCFE" class="text-block-content">
    <p>If you have multiple parts in your assessment, you may assign the question to a different part.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Assign to pool. (Optional)</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/002/142/841/original/505b9418-bad7-4dc2-a531-5d685a83a8f7.png" alt="" height="44" width="587">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_FECAFA11-EDD8-4BB6-81CD-E16A15878CFD" class="text-block-content">
    <p>If you have an existing question pool and would like to copy this question to the pool, select the pool name here.</p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Add feedback for correct answer and/or incorrect answer. (Optional)</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/002/142/821/original/a7a0c6c7-2036-4caf-9237-5200a09c56ab.png" alt="" height="429" width="729">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_ACFED792-A0A0-4F3B-B89F-E5060B75C34D" class="text-block-content">
    <p>Feedback is optional text available for the student to review after the particular question is graded. For numeric response questions, the feedback option is offered for correct and/or incorrect answers, if desired.</p>
<p><em>Note: To edit with the Rich Text Editor, click the hyperlink to open the full menu.</em></p>
  </div>
</div>
 
  </div>

      <div class="step screensteps-section screensteps-depth-1">
    <h2 class="step-title screensteps-heading">Click Save.</h2>
        <div class="image screensteps-image">
      <img src="https://media.screensteps.com/image_assets/assets/009/373/797/original/cbf43742-a1d6-48e0-9dae-634b31af8238.png" alt="" height="50" width="171">
  </div>
 
      <div class="step-instructions screensteps-textblock">
  <div id="text-content_6758E162-71B4-44E9-8A41-C4D3AA30CEF7" class="text-block-content">
    <p>Click <strong>Save</strong> to save the question (or <strong>Cancel</strong> to exit).</p>
  </div>
</div>
 
  </div>


</div>
</div></div>
</body>
</html>
